//2009/08/18 01:06:15
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <math.h>
#include <sstream>
#include <algorithm>

using namespace std;

class SwimmersDelight
{
public:
    int longestJump(vector <int> x, vector <int> y)
    {
		int x1 = x[0];
		int x2 = x[1];
		int y1 = y[0];
		int y2 = y[1];
		cout << x1 << y1 << x2 << y2 << endl;
        double mmax = max(x1, 10 - x1);
		cout << "mmax: " << mmax << endl;
		mmax = min(mmax, max(1.0*x2, 10.0 - x2));
        double dist = sqrt((x1 - x2) * (x1 - x2)  +  (y1 - y2) * (y1 - y2));
		mmax = min(mmax, max(1.*x1, max(dist, 10.0-x2)));
		mmax = min(mmax, max(1.*x2, max(dist, 10.0-x1)));
		cout << "dis: " << dist << endl;
        return round(mmax);
    }
};
